using System.Drawing;
using System.Drawing.Drawing2D;

namespace SinBiota.Model.Business.MapServices.Datatypes
{
    // Fill color and style, and boundary color and with, to draw a polygon or layer.
    public class GeographyDrawingStyle
    {
        public Color? FillColor;
        public HatchStyle? FillStyle;
        public Color? BoundaryColor;
        public int BoundaryWidth;

        public bool HasFill()
        {
            return FillColor.HasValue;
        }
        public Brush FillBrush()
        {
            if (!FillColor.HasValue) return null;
            if (FillStyle.HasValue)
            {
                return new HatchBrush(FillStyle.Value, Color.Empty, FillColor.Value);
            }
            return new SolidBrush(FillColor.Value);
        }
        public bool HasBoundary()
        {
            return BoundaryColor.HasValue;
        }
        public Pen BoundaryPen()
        {
            return BoundaryColor.HasValue ? new Pen(BoundaryColor.Value, BoundaryWidth) : null;
        }
        
    }
}